package testHutools.testStrUtil;

import cn.hutool.core.util.StrUtil;
import org.junit.Test;

/**
 * @version 1.0.0
 * Created by cyd on 2023-03-21 14:24:14
 * @Description : 测试字符串切割
 */
public class SlicingTest {

    /**
     * 测试前后切割
     */
    @Test
    public void test01() {
        String str01 = "7SDCA5547400S09";
        String str02 = "A";
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(str01).append(str02);

        System.out.println("stringBuilder:" + stringBuilder);

        String result01 = StrUtil.subSufByLength(stringBuilder, 4);
        System.out.println("result01:" + result01);

        String result02 = StrUtil.subPre(stringBuilder, 1);
        System.out.println("result02:" + result02);


        System.out.println("result03:" + stringBuilder.substring(0, stringBuilder.length() - 1));
    }

}
